import App from './App'
import fui from './common/fui-app'
import uviewPlus from '@/uni_modules/uview-plus'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
Vue.prototype.fui = fui
App.mpType = 'app'
const app = new Vue({
	...App
})

app.$mount()
// #endif

// #ifdef VUE3

import {
	createSSRApp
} from 'vue'
//#ifdef APP-PLUS
import {
	Button
} from 'vant'
import {
	Field
} from 'vant'
import {
	Checkbox,
	CheckboxGroup
} from 'vant'
import {
	Cell,
	CellGroup
} from 'vant';
import {
	Collapse,
	CollapseItem
} from 'vant';
import {
	Icon
} from 'vant';
import {
	Popup
} from 'vant';
import {
	SwipeCell
} from 'vant';
import {
	Signature
} from 'vant';
import {
	Image as VanImage
} from 'vant';
import {
	Uploader
} from 'vant';
import {
	PickerGroup
} from 'vant';
import {
	DatePicker
} from 'vant';
import {
	TimePicker
} from 'vant';
import {
	Empty
} from 'vant';
import {
	Tab,
	Tabs
} from 'vant';
import {
	DropdownMenu,
	DropdownItem
} from 'vant';
import 'vant/lib/index.css'
// #endif

import store from './store'
// // #ifdef MP-WEIXIN
// import './uni.promisify.adaptor'
// const app = new Vue({
//   ...App
// })
// app.$mount()
// //#endif

export function createApp() {
	const app = createSSRApp(App)
	app.use(uviewPlus)
	app.use(store)
	//#ifdef APP-PLUS
	app.use(DropdownItem);
	app.use(DropdownMenu);
	app.use(Tab);
	app.use(Tabs);
	app.use(Empty)

	app.use(Button)
	app.use(Field)
	app.use(Checkbox).use(CheckboxGroup)
	app.use(Cell).use(CellGroup)
	app.use(Collapse).use(CollapseItem)
	app.use(Icon)
	app.use(Popup)
	app.use(SwipeCell)
	app.use(Signature);
	app.use(VanImage);
	app.use(Uploader);
	app.use(PickerGroup);
	app.use(DatePicker);
	app.use(TimePicker);
	// #endif
	return {
		app
	}
}
//#endif